<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body" style="height:100%;">
          <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>会员信息</legend>
          </fieldset>
          <div class="layui-form">
            <table class="layui-table" lay-size="lg">
              <colgroup>
                <col width="150">
                <col width="200">
                <col>
              </colgroup>
              <thead>
                <tr>
                  <th>姓名</th>
                  <th>电话</th>
                  <th>等级</th>
                  <th>余额</th>
                  <th>地址</th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td><?=$info['name']?></td>
                  <td><?=$info['phone']?></td>
                  <td><?=c("type.user_level")[$info['level']]?></td>
                  <td><?=$info['money']?></td>
                  <td><?=$info['address']?></td>
                </tr>
              </tbody>
            </table>
          </div>

          <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
            <legend>列表</legend>
          </fieldset>

          <div class="layui-row layui-form" id="form">
            <div class="layui-col-lg2">
              <input type="hidden" name="id" value="<?=$info['id']?>" >
            </div>
          </div>
          <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
              <li class="layui-tdis layui-this">订单列表</li>
              <li>推荐会员</li>
              <li>下级会员</li>
              <li>账单列表</li>
            </ul>
            <div class="layui-tab-content" >
              <div class="layui-tab-item layui-show">
                <table class="layui-hide" lay-filter="table" id="table"></table>
              </div>

              <div class="layui-tab-item">
                <div class="layui-form layui-border-box layui-table-view" lay-filter="LAY-table-1" style=" ">
                  <div class="layui-table-box">
                    <div class="layui-table-header">
                      <table cellspacing="0" cellpadding="0" border="0" class="layui-table">
                        <thead>
                          <tr>
                            <th data-field="id">
                              <div class="layui-table-cell laytable-cell-1-id">
                                <span>ID</span>
                                <span class="layui-table-sort layui-inline">
                                  <i class="layui-edge layui-table-sort-asc"></i>
                                  <i class="layui-edge layui-table-sort-desc"></i>
                                </span>
                              </div>
                            </th>
                            <th data-field="name">
                              <div class="layui-table-cell laytable-cell-1-name">
                                <span>姓名</span>
                              </div>
                            </th>
                            <th data-field="phone">
                              <div class="layui-table-cell laytable-cell-1-phone">
                                <span>电话</span>
                              </div>
                            </th>
                            <th data-field="address">
                              <div class="layui-table-cell laytable-cell-1-address">
                                <span>地址</span>
                              </div>
                            </th>
                            <th data-field="level">
                              <div class="layui-table-cell laytable-cell-1-level">
                                <span>等级</span>
                              </div>
                            </th>
                            <th data-field="money">
                              <div class="layui-table-cell laytable-cell-1-money">
                                <span>余额</span>
                              </div>
                            </th>
                            <th data-field="status">
                              <div class="layui-table-cell laytable-cell-1-status">
                                <span>状态</span>
                              </div>
                            </th>
                          </tr>
                        </thead>
                      </table>
                    </div>
                    <div class="layui-table-body layui-table-main">
                      <table cellspacing="0" cellpadding="0" border="0" class="layui-table">
                        <?php foreach($user as $k => $v):?>
                        <tbody>
                          <tr data-index="0" class="">
                            <td data-field="id">
                              <div class="layui-table-cell laytable-cell-1-id"><?=$v['id']?></div>
                            </td>
                            <td data-field="name">
                              <div class="layui-table-cell laytable-cell-1-name"><?=$v['name']?></div>
                            </td>
                            <td data-field="phone">
                              <div class="layui-table-cell laytable-cell-1-phone"><?=$v['phone']?></div>
                            </td>
                            <td data-field="address">
                              <div class="layui-table-cell laytable-cell-1-address"><?=$v['address']?></div>
                            </td>
                            <td data-field="level">
                              <div class="layui-table-cell laytable-cell-1-level"><?=c('type.user_level')[$v['level']]?></div>
                            </td>
                            <td data-field="money">
                              <div class="layui-table-cell laytable-cell-1-money"><?=$v['money']?></div>
                            </td>
                            <td data-field="status">
                              <div class="layui-table-cell laytable-cell-1-status"><?=c('type.status')[$v['status']]?></div>
                            </td>
                          </tr>
                        </tbody>
                        <?php endforeach;?>
                      </table>
                    </div>
                  </div>
                </div>
                <style>
                  .laytable-cell-1-id{ width: 80px; }
                  .laytable-cell-1-name{ width: 180px; }
                  .laytable-cell-1-phone{ width: 180px; }
                  .laytable-cell-1-address{ width: 180px; }
                  .laytable-cell-1-level{ width: 180px; }
                  .laytable-cell-1-money{ width: 180px; }
                  .laytable-cell-1-status{ width: 180px; }
                </style>
              </div>

              <div class="layui-tab-item">
                <div class="layui-form layui-border-box layui-table-view" lay-filter="LAY-table-1" style=" ">
                  <div class="layui-table-box">
                    <div class="layui-table-header">
                      <table cellspacing="0" cellpadding="0" border="0" class="layui-table">
                        <thead>
                          <tr>
                            <th data-field="id">
                              <div class="layui-table-cell laytable-cell-1-id">
                                <span>ID</span>
                                <span class="layui-table-sort layui-inline">
                                  <i class="layui-edge layui-table-sort-asc"></i>
                                  <i class="layui-edge layui-table-sort-desc"></i>
                                </span>
                              </div>
                            </th>
                            <th data-field="name">
                              <div class="layui-table-cell laytable-cell-1-name">
                                <span>姓名</span>
                              </div>
                            </th>
                            <th data-field="phone">
                              <div class="layui-table-cell laytable-cell-1-phone">
                                <span>电话</span>
                              </div>
                            </th>
                            <th data-field="address">
                              <div class="layui-table-cell laytable-cell-1-address">
                                <span>地址</span>
                              </div>
                            </th>
                            <th data-field="level">
                              <div class="layui-table-cell laytable-cell-1-level">
                                <span>等级</span>
                              </div>
                            </th>
                            <th data-field="money">
                              <div class="layui-table-cell laytable-cell-1-money">
                                <span>余额</span>
                              </div>
                            </th>
                            <th data-field="status">
                              <div class="layui-table-cell laytable-cell-1-status">
                                <span>状态</span>
                              </div>
                            </th>
                          </tr>
                        </thead>
                      </table>
                    </div>
                    <div class="layui-table-body layui-table-main">
                      <table cellspacing="0" cellpadding="0" border="0" class="layui-table">
                        <?php foreach($s_user as $k => $v):?>
                        <tbody>
                          <tr data-index="0" class="">
                            <td data-field="id">
                              <div class="layui-table-cell laytable-cell-1-id"><?=$v['id']?></div>
                            </td>
                            <td data-field="name">
                              <div class="layui-table-cell laytable-cell-1-name"><?=$v['name']?></div>
                            </td>
                            <td data-field="phone">
                              <div class="layui-table-cell laytable-cell-1-phone"><?=$v['phone']?></div>
                            </td>
                            <td data-field="address">
                              <div class="layui-table-cell laytable-cell-1-address"><?=$v['address']?></div>
                            </td>
                            <td data-field="level">
                              <div class="layui-table-cell laytable-cell-1-level"><?=c('type.user_level')[$v['level']]?> </div>
                            </td>
                            <td data-field="money">
                              <div class="layui-table-cell laytable-cell-1-money"><?=$v['money']?></div>
                            </td>
                            <td data-field="status">
                              <div class="layui-table-cell laytable-cell-1-status"><?=c('type.status')[$v['status']]?></div>
                            </td>
                          </tr>
                        </tbody>
                        <?php endforeach;?>
                      </table>
                    </div>
                  </div>
                </div>
                <style>
                  .laytable-cell-1-id{ width: 80px; }
                  .laytable-cell-1-name{ width: 180px; }
                  .laytable-cell-1-phone{ width: 180px; }
                  .laytable-cell-1-address{ width: 180px; }
                  .laytable-cell-1-level{ width: 180px; }
                  .laytable-cell-1-money{ width: 180px; }
                  .laytable-cell-1-status{ width: 180px; }
                </style>
              </div>

              <div class="layui-tab-item">
                <div class="layui-form layui-border-box layui-table-view" lay-filter="LAY-table-1" style=" ">
                  <div class="layui-table-box">
                    <div class="layui-table-header">
                      <table cellspacing="0" cellpadding="0" border="0" class="layui-table">
                        <thead>
                          <tr>
                            <th data-field="id">
                              <div class="layui-table-cell laytable-cell-1-id">
                                <span>ID</span>
                                <span class="layui-table-sort layui-inline">
                                  <i class="layui-edge layui-table-sort-asc"></i>
                                  <i class="layui-edge layui-table-sort-desc"></i>
                                </span>
                              </div>
                            </th>
                            <th data-field="order_no">
                              <div class="layui-table-cell laytable-cell-1-order_no">
                                <span>订单编号</span>
                              </div>
                            </th>
                            <th data-field="phone">
                              <div class="layui-table-cell laytable-cell-1-phone">
                                <span>订单类型</span>
                              </div>
                            </th>
                            <th data-field="before_money">
                              <div class="layui-table-cell laytable-cell-1-before_money">
                                <span>变动前金额</span>
                              </div>
                            </th>
                            <th data-field="show_money">
                              <div class="layui-table-cell laytable-cell-1-show_money">
                                <span>金额</span>
                              </div>
                            </th>
                            <th data-field="after_money">
                              <div class="layui-table-cell laytable-cell-1-after_money">
                                <span>变动之后金额</span>
                              </div>
                            </th>
                            <th data-field="fee">
                              <div class="layui-table-cell laytable-cell-1-fee">
                                <span>手续费</span>
                              </div>
                            </th>
                            <th data-field="note">
                              <div class="layui-table-cell laytable-cell-1-note">
                                <span>备注</span>
                              </div>
                            </th>
                            <th data-field="create_time">
                              <div class="layui-table-cell laytable-cell-1-create_time">
                                <span>时间</span>
                              </div>
                            </th>
                          </tr>
                        </thead>
                      </table>
                    </div>
                    <div class="layui-table-body layui-table-main">
                      <table cellspacing="0" cellpadding="0" border="0" class="layui-table">
                        <?php foreach($bill as $k => $v):?>
                        <tbody>
                          <tr data-index="0" class="">
                            <td data-field="id">
                              <div class="layui-table-cell laytable-cell-1-id"><?=$v['id']?></div>
                            </td>
                            <td data-field="order_no">
                              <div class="layui-table-cell laytable-cell-1-order_no"><?=$v['order_no']?></div>
                            </td>
                            <td data-field="type">
                              <div class="layui-table-cell laytable-cell-1-type"><?=c('type.user_bill_type')[$v['type']]?></div>
                            </td>
                            <td data-field="before_money">
                              <div class="layui-table-cell laytable-cell-1-before_money"><?=$v['before_money']?></div>
                            </td>
                            <td data-field="show_money">
                              <div class="layui-table-cell laytable-cell-1-show_money"><?=$v['show_money']?> </div>
                            </td>
                            <td data-field="after_money">
                              <div class="layui-table-cell laytable-cell-1-after_money"><?=$v['after_money']?></div>
                            </td>
                            <td data-field="fee">
                              <div class="layui-table-cell laytable-cell-1-fee"><?=$v['fee']?></div>
                            </td>
                            <td data-field="note">
                              <div class="layui-table-cell laytable-cell-1-note"><?=$v['note']?></div>
                            </td>
                            <td data-field="create_time">
                              <div class="layui-table-cell laytable-cell-1-create_time"><?=com_time_format($v['create_time'])?></div>
                            </td>
                          </tr>
                        </tbody>
                        <?php endforeach;?>
                      </table>
                    </div>
                  </div>
                </div>
                <style>
                  .laytable-cell-1-id{ width: 80px; }
                  .laytable-cell-1-order_no{ width: 180px; }
                  .laytable-cell-1-type{ width: 180px; }
                  .laytable-cell-1-before_money{ width: 180px; }
                  .laytable-cell-1-show_money{ width: 180px; }
                  .laytable-cell-1-after_money{ width: 180px; }
                  .laytable-cell-1-fee{ width: 180px; }
                  .laytable-cell-1-note{ width: 180px; }
                  .laytable-cell-1-create_time{ width: 180px; }
                </style>
              </div>
            </div>
          </div>
      </div>
    </div>
</div>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs layui-btn-primary" lay-event="detail">详情</a>

</script>
<script>
layui
.use(['table','larry'], function(){
    var table = layui.table;
    var $ = layui.$;
    var larry = layui.larry;
    search = function(){
        var url = "/user/order_lists";
        var data = $("#form").find("[name]");
        var where = {};
        data.each(function(i,e){
            where[$(e).attr('name')] = $(e).val();
        });
        table.render({
            elem: '#table'
            ,url:url
            ,where:where
            ,method:'post'
            ,cellMinWidth:180
            ,page: true
            ,cols: [[
                //{type:'checkbox'},
                {field:'id', title: 'ID',width:80, sort: true,title:'ID'}
                ,{field:'order_no', title: '订单编号'}
                ,{field:'title', title: '公司名称'}
                ,{field:'phone', title: '公司电话'}
                ,{field:'name', title: '服务员姓名'}
                ,{field:'w_phone', title: '服务员电话'}
                ,{field:'g_title', title: '服务'}
                ,{field:'money', title: '价格'}
                ,{field:'cost_price', title: '成本价'}
                ,{field:'price', title: '实际收费'}
                ,{field:'pv', title: 'pv'}
                ,{field:'start_time', title: '服务开始时间'}
                ,{field:'end_time', title: '服务结束时间'}
                ,{field:'fw_times', title: '服务次数'}
                ,{field:'fw_address', title: '服务地点'}
                ,{field:'fw_name', title: '服务联系人'}
                ,{field:'fw_phone', title: '服务联系电话'}
                ,{field:'note', title: '备注'}
                ,{field:'fw_note', title: '服务反馈'}
                ,{field:'status', title: '状态'}
                ,{field:'create_time', title: '创建时间'}
                ,{field:'action', title: '操作',width:178, align:'center', toolbar: '#barDemo',fixed:"right",}
            ]]
        });
    };
    search();
     //监听工具条
      table.on('tool(table)', function(obj){
        var data = obj.data;
        if(obj.event === 'detail'){
            layer.open({
                title:'详情',
                type:2,
                area: ['100%', '100%'],
                content:'/ordergoods/detail?id='+data.id
            });
        }
      });
});
</script>